#ifndef CC_VPORT_SIMULATION_H
#define CC_VPORT_SIMULATION_H

/*** Public header file */
#include "basic_api.h"


/*** Define */
#define CFG_VPORT_SIMU
#define CFG_VPORT_SIMU_APP

#ifdef CFG_VPORT_SIMU
typedef struct CC_vPort_Simulation_ByBFIFO tSimuPort; 

//
extern int SimuPort_Write(tSimuPort* pObj,uint16_t Len ,uint8_t* pPkg);
extern int SimuPort_Read (tSimuPort* pObj,uint16_t RLen,uint8_t* pRBuf);
extern int SimuPort_Ctrl (tSimuPort* pObj,uint16_t Cmd ,uint16_t Len,uint8_t* pPara);

extern void SimuPort_Show(tSimuPort* pObj);
extern tSimuPort* SimuPort_Create(uint16_t RxTxBufSz,tMs TxPeriod,uint16_t RBufSz);

extern int SimuPort_RxInput(tSimuPort* pObj,uint16_t Len,uint8_t* pPkg);
extern int SimuPort_BindTxOutput(tSimuPort* pObj,int(*pTxFunc)(uint16_t,uint8_t*) );

#endif 

#ifdef CFG_VPORT_SIMU_APP

extern int SimuPort_MasterSlave_Init(void);

extern int SPort_Master_Write(uint16_t Len,uint8_t* pPkg);
extern int SPort_Master_Read(uint16_t RLen,uint8_t* pRBuf);
extern int SPort_Master_Ctrl(uint16_t Cmd,uint16_t Len,uint8_t* pPara);

extern int SPort_Slave_Write(uint16_t Len,uint8_t* pPkg);
extern int SPort_Slave_Read(uint16_t RLen,uint8_t* pRBuf);
extern int SPort_Slave_Ctrl(uint16_t Cmd,uint16_t Len,uint8_t* pPara);

#endif

#endif

